package com.shop.cereshop.business.dl.logic.exception;

import cn.hutool.core.date.DateTime;
import lombok.Data;

/**
 * @description 封装异常信息类
 * @Author YF
 * @Date 日期:2021/4/13 时间:19:20
 */
@Data
public class ExceptionResult {
    private Integer code;
    private String message;
    private String timestamp;

    public ExceptionResult(Integer status,String message){
     this.code = status;
     this.message = message;
     this.timestamp = DateTime.now().toString("yyyy-MM-dd HH:mm:ss");
    }

    public ExceptionResult(DlException dlException){
        this.code = dlException.getCode();
        this.message = dlException.getMessage();
        this.timestamp = DateTime.now().toString("yyyy-MM-dd HH:mm:ss");
    }


}
